import { createStore } from 'vuex'
import user from './modules/user'
import cart from './modules/cart'
import category from './modules/category'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  modules: {
    user,
    cart,
    category
  },

  // 插件选项
  plugins: [
    createPersistedstate(
      { key: 'rabit', paths: ['user', 'cart'] }
    )
  ]
})
